public class Test {
    public static boolean Return(char s){

            if(('a'<=s&&s<='z'||'0'<=s&&s<='9')){
                return false;
            }
            else return true;
    }
    public static boolean isPalindrome(String s) {
        s=s.toLowerCase();
        int x=0;
        int y=s.length()-1;
        while(x<y){
          while (x<y&&!Return(s.charAt(x))){
           x++;
       }
            while(x<y&&!Return(s.charAt(y))){
                y--;
            }
            if(s.charAt(x)!=s.charAt(y)){
                return false;
            }
            else {
                x++;
                y--;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        String s="abba";
        System.out.println(isPalindrome(s));
    }
}
